Java Performance: The Definitive Guide by Scott Oaks

Java Performance: The Definitive Guide by Scott Oaks

Author:Scott Oaks
Language: eng
Format: epub, mobi, pdf
ISBN: 9781449358457
Publisher: O’Reilly Media, Inc.
Published: 2014-06-13T16:00:00+00:00


10

0.258 seconds

0.236 seconds

100

0.564 seconds

0.49 seconds

1,000

2.308 seconds

1.916 seconds

10,000

17.32 seconds

13.55 seconds

The lesson here—and in general for object reuse—is that when initialization of objects takes a long time, don’t be afraid to explore object pooling or thread-local variables to reuse those expensive-to-create objects. As always, though, strike a balance: large object pools of generic classes will most certainly lead to more performance issues than they solve. Leave these techniques to classes that are expensive to initialize, and when the number of the reused objects will be small.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.